{% extends 'siteAdmin/siteAdmin.html' %}
{% block operation %}
{% include 'siteAdmin/tinyPart.html' with context %}

{% if req.path ==pageData['subdomain']+'/siteAdmin/feedAdd' %}

        <div id="box">
        {% if pageData['feed'].id %}
            <form method ="POST" action="{{pageData['subdomain']}}/siteAdmin/feedAdd?update={{pageData['feed'].id}}">
        {% else %}
            <form  method="POST" action="{{pageData['subdomain']}}/siteAdmin/feedAdd?add">
        {% endif %}

                <span class="word">titolo</span><br />
                <span class="insert">
                <input name="name" type="text" value ="{{pageData['feed'].name|nonone}}" style="width: 80%"/></span><br /><br />
                <span class="word">URL</span><br />
                <span class="insert">
                <input name="url" type="text" value ="{{pageData['feed'].url|nonone}}" style="width: 80%"/></span><br /><br />
                            <div class="row thin lineTop"><br /><br />
                <input type="submit" class="wymupdate" value="Aggiungi/modifica"/>
            </form>
            <br />

        </div>
    {% elif req.path ==pageData['subdomain']+'/siteAdmin/feedList' %}
        <div id="box">
                <span class="testa"><h2>Gestione Feed Notizie</h2></span>
                <hr></hr>
                <div class="row normal">
                <a href="{{pageData['subdomain']}}/siteAdmin/feedAdd?new">
                    <img src="/templates/siteAdmin/img/add.png" alt="aggiungi una sorgente feed" title="aggiungi una sorgente feed"/>
                </a>
                </div>
                {% for feed in pageData['feeds'] %}
                <div class="row normal lineTop" >
                    <span>{{feed.name}}</span>
                    <span class="image"><a href="{{pageData['subdomain']}}/siteAdmin/feedDel?feedId={{feed.id}}"
                                        onClick='return confirm("Sei sicuro di voler cancellare questa pagina?")' >
                                        <img src="/templates/siteAdmin/img/trash.png" alt="elimina unfeed" title="elimina una pagina"/></a></span>
                    <span class="image"><a href="{{pageData['subdomain']}}/siteAdmin/feedAdd?edit={{feed.id}}">
                                        <img src="/templates/siteAdmin/img/modifica.png" alt="modifica un feed" title="modifica una pagina"/></a></span>
                </div>
                {% endfor %}
            <ul class="pages">
                <li class="prima">Pagine</li>
                {% for i in range(0,pageData['item']) %}
                    {% if i != pageData['pag'] %}
                        <li><a href="{{pageData['subdomain']}}/siteAdmin/staticPagesList?pag={{i+1}}">{{i+1}}</a></li>
                    {% else %}
                        <li>[<a href="{{pageData['subdomain']}}/siteAdmin/staticPagesList?pag={{i+1}}">{{i+1}}</a>]</li>
                    {% endif %}
                {% endfor %}
            </ul>
                <div class="row normal lineTop">
                <a href="{{pageData['subdomain']}}/siteAdmin/feedAdd?new">
                    <img src="/templates/siteAdmin/img/add.png" alt="aggiungi una pagina" title="aggiungi una pagina"/>
                </a>
                </div>
        </div>

{% endif %}
        </div>
{%endblock%}
